Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid ambiguity of placeholder on nested parameter #7454

Conversation

mrussoLuxoft
Copy link
Contributor

This PR is related to the Issue #7453 proposing multiple changes to clarify the text in [dcl.spec.auto.general]
However, a PR has been created for each specific change.

In [dcl.spec.auto.general]-p2 and p5, an additional text about the case of function type, may avoid the general interpretation of using a placeholder type for nested parameters.

@@ -1779,7 +1779,8 @@
\opt{\grammarterm{type-constraint}} \keyword{auto}.
The placeholder type shall appear
as one of the \grammarterm{decl-specifier}{s} in
the \grammarterm{decl-specifier-seq} or
the \grammarterm{decl-specifier-seq} or,
in case of function pointer type,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced this is a good change. At the very least, reference-to-function types should be included, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point.

I will try to a better way, unless you have suggestions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposed a new way, not sure whether for p5 it was really needed to repeat the same note.

@jensmaurer jensmaurer added the changes requested Changes to the wording or approach have been requested and not yet applied. label Nov 27, 2024
@mrussoLuxoft mrussoLuxoft force-pushed the clarify__dcl_spec_auto_general__3 branch from e589a2a to afc0ac3 Compare November 27, 2024 23:59
@jensmaurer jensmaurer removed the changes requested Changes to the wording or approach have been requested and not yet applied. label Dec 4, 2024
@jensmaurer
Copy link
Member

jensmaurer commented Dec 4, 2024

Hm... I think this entire change is unnecessary. We clearly say "the type of a parameter-declaration of a function declaration" (not "function type"). A nested function type is not a function declaration.

We had situations where we said "in", and those were considered ambiguous whether applying to the top level or to nested levels. We believe we've addressed this by using "of", which we believe linguistically excludes nested levels.

The standard is not a tutorial.

@mrussoLuxoft
Copy link
Contributor Author

ok, you are saying that, despite we have 'IN' during the clarifying wording "... The placeholder type shall appear as one of the [decl-specifier]s IN the [decl-specifier-seq] ...",
then we are safe because the nested parameters are not part of the [decl-specifier-seq] but part of the eventual [declarator] of [parameter-declaration].

If, in addition, the term 'THE' in the aforementioned wording "... in THE [decl-specifier-seq] ..." is a non-ambiguous reference to the one directly related to the original [parameter-declaration], then ok to me.

@jensmaurer
Copy link
Member

For the "IN" decl-specifier-seq, "of" would work well (and be slightly better), but (as you correctly observe), there is no recursion going on via the decl-specifier-seq.

For "THE decl-specifier-seq", I think there is none in sight here where "THE" could refer to other than the one of the parameter-declaration.

@jensmaurer jensmaurer closed this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants